﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace BoxDiary
{
    public partial class Main : Form
    {
        public Main()
        {
            InitializeComponent();
        }

        public static bool SAE = false;

        private void button2_Click_1(object sender, EventArgs e)
        {
            Functions.Controls.Clear();
            Functions.Controls.Add(new ReadDiary());
        }

        private void Main_Load(object sender, EventArgs e)
        {
            Functions.Focus();
            button6.Visible = false;
            Functions.Controls.Add(new StartMenu());

            //是否开启SAE
            string saeOpened = IniOperator.Read(
                "Lab", "Single account encryption", Application.StartupPath + @"\Settings\settings.ini"
                );

            if (saeOpened == "Open")
            {
                SAE = true;
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Functions.Controls.Clear();
            Functions.Controls.Add(new WriteDiary());
        }

        private void dr_set_Cilck(object sender, EventArgs e)
        {
            Functions.Controls.Clear();
            Functions.Controls.Add(new DiaryController());
        }

        private void setCilck(object sender, EventArgs e)
        {
            Functions.Controls.Clear();
            Functions.Controls.Add(new Settings());
        }

        private void Functions_Paint(object sender, PaintEventArgs e)
        {

        }

        private void button6_Click(object sender, EventArgs e)
        {

        }

        private void button5_Click(object sender, EventArgs e)
        {
            Functions.Controls.Clear();
            Functions.Controls.Add(new About());
        }
    }
}
